<html>
<head><meta charset="utf-8"><title>Can&#x27;t build due to depending on tensorflow? · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Can&#x27;t.20build.20due.20to.20depending.20on.20tensorflow.3F.html">Can&#x27;t build due to depending on tensorflow?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="209144073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Can%27t%20build%20due%20to%20depending%20on%20tensorflow%3F/near/209144073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Can&#x27;t.20build.20due.20to.20depending.20on.20tensorflow.3F.html#209144073">(Sep 04 2020 at 21:47)</a>:</h4>
<p>I'm trying to build the compiler and getting a puzzling warning about llvm depending on Tensorflow and a (supressed?) panic leading up to that.</p>
<div class="codehilite"><pre><span></span><code> python x.py build
Updating only changed submodules
Submodules updated in 0.02 seconds
    Finished dev [unoptimized + debuginfo] target(s) in 0.11s
Building stage0 std artifacts (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.11s
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building LLVM for x86_64-unknown-linux-gnu
running: &quot;cmake&quot; &quot;/home/andreas/code/projects/rust/src/llvm-project/llvm&quot; &quot;-G&quot; &quot;Ninja&quot; &quot;-DLLVM_ENABLE_ASSERTIONS=OFF&quot; &quot;-DLLVM_TARGETS_TO_BUILD=X86&quot; &quot;-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=AVR&quot; &quot;-DLLVM_INCLUDE_EXAMPLES=OFF&quot; &quot;-DLLVM_INCLUDE_TESTS=OFF&quot; &quot;-DLLVM_INCLUDE_DOCS=OFF&quot; &quot;-DLLVM_INCLUDE_BENCHMARKS=OFF&quot; &quot;-DWITH_POLLY=OFF&quot; &quot;-DLLVM_ENABLE_TERMINFO=OFF&quot; &quot;-DLLVM_ENABLE_LIBEDIT=OFF&quot; &quot;-DLLVM_ENABLE_BINDINGS=OFF&quot; &quot;-DLLVM_ENABLE_Z3_SOLVER=OFF&quot; &quot;-DLLVM_PARALLEL_COMPILE_JOBS=4&quot; &quot;-DLLVM_TARGET_ARCH=x86_64&quot; &quot;-DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-linux-gnu&quot; &quot;-DLLVM_ENABLE_ZLIB=ON&quot; &quot;-DLLVM_LINK_LLVM_DYLIB=ON&quot; &quot;-DLLVM_ENABLE_LIBXML2=OFF&quot; &quot;-DLLVM_VERSION_SUFFIX=-rust-dev&quot; &quot;-DPYTHON_EXECUTABLE=/usr/bin/python&quot; &quot;-DCMAKE_INSTALL_MESSAGE=LAZY&quot; &quot;-DCMAKE_C_COMPILER=cc&quot; &quot;-DCMAKE_CXX_COMPILER=c++&quot; &quot;-DCMAKE_ASM_COMPILER=cc&quot; &quot;-DCMAKE_C_FLAGS=-ffunction-sections -fdata-sections -fPIC -m64&quot; &quot;-DCMAKE_CXX_FLAGS=-ffunction-sections -fdata-sections -fPIC -m64&quot; &quot;-DCMAKE_INSTALL_PREFIX=/home/andreas/code/projects/rust/build/x86_64-unknown-linux-gnu/llvm&quot; &quot;-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64&quot; &quot;-DCMAKE_BUILD_TYPE=Release&quot;
-- Native target architecture is X86
-- Threads enabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- Ninja version: 1.10.0
-- OCaml bindings disabled.
-- LLVM host triple: x86_64-unknown-linux-gnu
-- LLVM default target triple: x86_64-unknown-linux-gnu
-- Building with -fPIC
-- Constructing LLVMBuild project information
-- Targeting X86
-- Targeting AVR
Traceback (most recent call last):
  File &quot;&lt;string&gt;&quot;, line 22, in &lt;module&gt;
IndexError: list index out of range
-- Configuring done
-- Generating done
-- Build files have been written to: /home/andreas/code/projects/rust/build/x86_64-unknown-linux-gnu/llvm/build
running: &quot;cmake&quot; &quot;--build&quot; &quot;.&quot; &quot;--target&quot; &quot;install&quot; &quot;--config&quot; &quot;Release&quot; &quot;--&quot; &quot;-j&quot; &quot;4&quot;
ninja: error: &#39;/usr/lib/libtensorflow.so&#39;, needed by &#39;lib/libLLVM-11-rust-dev.so&#39;, missing and no known rule to make it
thread &#39;main&#39; panicked at &#39;
command did not execute successfully, got: exit code: 1

build script failed, must exit now&#39;, /home/andreas/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.44/src/lib.rs:885:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    finished in 1.476
failed to run: /home/andreas/code/projects/rust/build/bootstrap/debug/bootstrap build
</code></pre></div>



<a name="209144168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Can%27t%20build%20due%20to%20depending%20on%20tensorflow%3F/near/209144168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Can&#x27;t.20build.20due.20to.20depending.20on.20tensorflow.3F.html#209144168">(Sep 04 2020 at 21:48)</a>:</h4>
<p>Environvment: Arch Linux, commit <a href="https://github.com/rust-lang/rust/commit/42d896afbd0314375a12465a14dc8d23b1b73a55">42d896afbd0314375a12465a14dc8d23b1b73a55</a><br>
The only deviation from default config.toml is removing some uneeded architectures</p>



<a name="209144402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Can%27t%20build%20due%20to%20depending%20on%20tensorflow%3F/near/209144402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Can&#x27;t.20build.20due.20to.20depending.20on.20tensorflow.3F.html#209144402">(Sep 04 2020 at 21:52)</a>:</h4>
<div class="codehilite"><pre><span></span><code>-- Targeting AVR
Traceback (most recent call last):
  File &quot;&lt;string&gt;&quot;, line 22, in &lt;module&gt;
IndexError: list index out of range
</code></pre></div>


<p>Is that one of the architectures you disabled?</p>



<a name="209144424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Can%27t%20build%20due%20to%20depending%20on%20tensorflow%3F/near/209144424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Can&#x27;t.20build.20due.20to.20depending.20on.20tensorflow.3F.html#209144424">(Sep 04 2020 at 21:52)</a>:</h4>
<p>can you provide a diff of config.toml?</p>



<a name="209144439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Can%27t%20build%20due%20to%20depending%20on%20tensorflow%3F/near/209144439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Can&#x27;t.20build.20due.20to.20depending.20on.20tensorflow.3F.html#209144439">(Sep 04 2020 at 21:53)</a>:</h4>
<p>I suspect it might be ... finding tensorflow partially, deciding to link to it, and then failing?</p>



<a name="209144513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Can%27t%20build%20due%20to%20depending%20on%20tensorflow%3F/near/209144513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Can&#x27;t.20build.20due.20to.20depending.20on.20tensorflow.3F.html#209144513">(Sep 04 2020 at 21:54)</a>:</h4>
<p>The diff is:</p>
<div class="codehilite"><pre><span></span><code>65d64
&lt; targets = &quot;X86&quot;
</code></pre></div>



<a name="209144561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Can%27t%20build%20due%20to%20depending%20on%20tensorflow%3F/near/209144561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Can&#x27;t.20build.20due.20to.20depending.20on.20tensorflow.3F.html#209144561">(Sep 04 2020 at 21:55)</a>:</h4>
<p>So AVR appearing there is weird on its own, isn't it?</p>



<a name="209144681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Can%27t%20build%20due%20to%20depending%20on%20tensorflow%3F/near/209144681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Can&#x27;t.20build.20due.20to.20depending.20on.20tensorflow.3F.html#209144681">(Sep 04 2020 at 21:57)</a>:</h4>
<p>Perhaps, not sure why that would happen</p>



<a name="209144699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Can%27t%20build%20due%20to%20depending%20on%20tensorflow%3F/near/209144699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Can&#x27;t.20build.20due.20to.20depending.20on.20tensorflow.3F.html#209144699">(Sep 04 2020 at 21:57)</a>:</h4>
<p>maybe an upstream bug</p>



<a name="209144706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Can%27t%20build%20due%20to%20depending%20on%20tensorflow%3F/near/209144706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Can&#x27;t.20build.20due.20to.20depending.20on.20tensorflow.3F.html#209144706">(Sep 04 2020 at 21:57)</a>:</h4>
<p>I'm going to do a full clean of the repo, it's been a while and could be some pontentially old file interfereing.</p>



<a name="209145473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Can%27t%20build%20due%20to%20depending%20on%20tensorflow%3F/near/209145473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Can&#x27;t.20build.20due.20to.20depending.20on.20tensorflow.3F.html#209145473">(Sep 04 2020 at 22:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/131828-t-compiler/topic/Can't.20build.20due.20to.20depending.20on.20tensorflow.3F/near/209144439">said</a>:</p>
<blockquote>
<p>I suspect it might be ... finding tensorflow partially, deciding to link to it, and then failing?</p>
</blockquote>
<p>That might actually be it. I believe it was autoremoved from my system as an orphaned dependency a few weeks back.<br>
Weird that it sticks around in some files though, maybe the llvm build directory is improperly cleaned?</p>



<a name="209146813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Can%27t%20build%20due%20to%20depending%20on%20tensorflow%3F/near/209146813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Can&#x27;t.20build.20due.20to.20depending.20on.20tensorflow.3F.html#209146813">(Sep 04 2020 at 22:31)</a>:</h4>
<p>After <code>git clean -id</code> it seems fine. a <code>x.py clean</code> alone didn't do the trick.<br>
So nothing particularly worrying, just the some old artifact probably ^^</p>



<a name="209147595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Can%27t%20build%20due%20to%20depending%20on%20tensorflow%3F/near/209147595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Can&#x27;t.20build.20due.20to.20depending.20on.20tensorflow.3F.html#209147595">(Sep 04 2020 at 22:46)</a>:</h4>
<p>x.py clean doesn't touch llvm</p>



<a name="211050949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Can%27t%20build%20due%20to%20depending%20on%20tensorflow%3F/near/211050949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Vossen <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Can&#x27;t.20build.20due.20to.20depending.20on.20tensorflow.3F.html#211050949">(Sep 23 2020 at 19:25)</a>:</h4>
<p>I am experiencing this right now. I did a <code>x.py clean</code> and a <code>rm -rf build</code> and a <code>git clean -id</code>, but am still getting the error</p>



<a name="226175229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Can%27t%20build%20due%20to%20depending%20on%20tensorflow%3F/near/226175229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Vossen <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Can&#x27;t.20build.20due.20to.20depending.20on.20tensorflow.3F.html#226175229">(Feb 12 2021 at 18:12)</a>:</h4>
<p>In case anyone is searching around, I eventually fixed this by just downloading the llvm from CI by setting <a href="http://adc66c693e70f68920b6446f7f13e65fa0038b4e2eece1406d511af419efa8e6106a4745d48660097021685058298f1ea9ff4aa30b66dcc109e7d133">this line</a> to true, which works for my needs. Not the best solution, it is probably an outdated tensorflow version or something, but I don't have sudo permissions on the server I am doing this on so it'll do for now.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>